package com.hdax.dm.rest;

import com.hdax.dm.common.config.api.ImageControllerApi;
import com.hdax.dm.entity.base.Image;
import com.hdax.dm.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

//基于rest风格请求的
//提供的是远程服务能力，起到了控制器的作用

/*继承了父接口，加个component能扫描到就可以*/
@Component
public class ImageRestService implements ImageControllerApi {

    @Autowired
    private ImageService imageService;

    public Image image(@RequestParam("targetId")Long targetId,
                       @RequestParam("type")Long type,
                       @RequestParam("category")Long category){
        return imageService.image(targetId, type, category);
    }
}
